package dao;

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

import org.apache.torque.NoRowsException;
import org.apache.torque.TooManyRowsException;
import org.apache.torque.Torque;
import org.apache.torque.TorqueException;
import org.apache.torque.map.MapBuilder;
import org.apache.torque.map.TableMap;
import org.apache.torque.om.DateKey;
import org.apache.torque.om.NumberKey;
import org.apache.torque.om.StringKey;
import org.apache.torque.om.ObjectKey;
import org.apache.torque.om.SimpleKey;
import org.apache.torque.util.BasePeer;
import org.apache.torque.util.Criteria;

import com.workingdogs.village.DataSetException;
import com.workingdogs.village.QueryDataSet;
import com.workingdogs.village.Record;

// Local classes
import dao.map.*;


  
  
  
  
  
  
  
  
  
  
  
  
  
/**
 * This class was autogenerated by Torque on:
 *
 * [Fri Jan 09 02:39:32 PST 2009]
 *
 */
public abstract class BaseStudentPersonalInformationPeer
    extends BasePeer
{

    /** the default database name for this class */
    public static final String DATABASE_NAME = "registnetdb";

     /** the table name for this class */
    public static final String TABLE_NAME = "student_personal_information";

    /**
     * @return the map builder for this peer
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static MapBuilder getMapBuilder()
        throws TorqueException
    {
        return getMapBuilder(StudentPersonalInformationMapBuilder.CLASS_NAME);
    }

      /** the column name for the STUDENTPERSONALINFORMATIONID field */
    public static final String STUDENTPERSONALINFORMATIONID;
      /** the column name for the STUDENTID field */
    public static final String STUDENTID;
      /** the column name for the SEX field */
    public static final String SEX;
      /** the column name for the BIRTHDATE field */
    public static final String BIRTHDATE;
      /** the column name for the CIVILSTATUS field */
    public static final String CIVILSTATUS;
      /** the column name for the CITIZENSHIP field */
    public static final String CITIZENSHIP;
      /** the column name for the RESIDENTIALADDRESS field */
    public static final String RESIDENTIALADDRESS;
      /** the column name for the RESIDENTIALADDRESSZIPID field */
    public static final String RESIDENTIALADDRESSZIPID;
      /** the column name for the RESIDENTIALADDRESSPROVINCEID field */
    public static final String RESIDENTIALADDRESSPROVINCEID;
      /** the column name for the RESIDENTIALADDRESSREGIONID field */
    public static final String RESIDENTIALADDRESSREGIONID;
      /** the column name for the RESIDENTIALADDRESSCOUNTRYID field */
    public static final String RESIDENTIALADDRESSCOUNTRYID;
      /** the column name for the COLLEGEADDRESS field */
    public static final String COLLEGEADDRESS;
      /** the column name for the COLLEGEADDRESSZIPID field */
    public static final String COLLEGEADDRESSZIPID;
      /** the column name for the COLLEGEADDRESSPROVINCEID field */
    public static final String COLLEGEADDRESSPROVINCEID;
      /** the column name for the COLLEGEADDRESSREGIONID field */
    public static final String COLLEGEADDRESSREGIONID;
      /** the column name for the COLLEGEADDRESSCOUNTRYID field */
    public static final String COLLEGEADDRESSCOUNTRYID;
      /** the column name for the TELEPHONENUMBER field */
    public static final String TELEPHONENUMBER;
      /** the column name for the CELLULARPHONENUMBER field */
    public static final String CELLULARPHONENUMBER;
      /** the column name for the EMAIL field */
    public static final String EMAIL;
      /** the column name for the HIGHSCHOOL field */
    public static final String HIGHSCHOOL;
      /** the column name for the HIGHSCHOOLGRADE field */
    public static final String HIGHSCHOOLGRADE;
      /** the column name for the FATHERFIRSTNAME field */
    public static final String FATHERFIRSTNAME;
      /** the column name for the FATHERMIDDLENAME field */
    public static final String FATHERMIDDLENAME;
      /** the column name for the FATHERLASTNAME field */
    public static final String FATHERLASTNAME;
      /** the column name for the MOTHERFIRSTNAME field */
    public static final String MOTHERFIRSTNAME;
      /** the column name for the MOTHERMIDDLENAME field */
    public static final String MOTHERMIDDLENAME;
      /** the column name for the MOTHERLASTNAME field */
    public static final String MOTHERLASTNAME;
      /** the column name for the GUARDIANFIRSTNAME field */
    public static final String GUARDIANFIRSTNAME;
      /** the column name for the GUARDIANMIDDLENAME field */
    public static final String GUARDIANMIDDLENAME;
      /** the column name for the GUARDIANLASTNAME field */
    public static final String GUARDIANLASTNAME;
      /** the column name for the GUARDIANADDRESS field */
    public static final String GUARDIANADDRESS;
      /** the column name for the GUARDIANADDRESSZIPID field */
    public static final String GUARDIANADDRESSZIPID;
      /** the column name for the GUARDIANADDRESSPROVINCEID field */
    public static final String GUARDIANADDRESSPROVINCEID;
      /** the column name for the GUARDIANADDRESSREGIONID field */
    public static final String GUARDIANADDRESSREGIONID;
      /** the column name for the GUARDIANADDRESSCOUNTRYID field */
    public static final String GUARDIANADDRESSCOUNTRYID;
      /** the column name for the GUARDIANCONTACTNUMBER field */
    public static final String GUARDIANCONTACTNUMBER;
      /** the column name for the GUARDIANRELATION field */
    public static final String GUARDIANRELATION;
      /** the column name for the GUARDIANEMAIL field */
    public static final String GUARDIANEMAIL;
  
    static
    {
          STUDENTPERSONALINFORMATIONID = "student_personal_information.STUDENTPERSONALINFORMATIONID";
          STUDENTID = "student_personal_information.STUDENTID";
          SEX = "student_personal_information.SEX";
          BIRTHDATE = "student_personal_information.BIRTHDATE";
          CIVILSTATUS = "student_personal_information.CIVILSTATUS";
          CITIZENSHIP = "student_personal_information.CITIZENSHIP";
          RESIDENTIALADDRESS = "student_personal_information.RESIDENTIALADDRESS";
          RESIDENTIALADDRESSZIPID = "student_personal_information.RESIDENTIALADDRESSZIPID";
          RESIDENTIALADDRESSPROVINCEID = "student_personal_information.RESIDENTIALADDRESSPROVINCEID";
          RESIDENTIALADDRESSREGIONID = "student_personal_information.RESIDENTIALADDRESSREGIONID";
          RESIDENTIALADDRESSCOUNTRYID = "student_personal_information.RESIDENTIALADDRESSCOUNTRYID";
          COLLEGEADDRESS = "student_personal_information.COLLEGEADDRESS";
          COLLEGEADDRESSZIPID = "student_personal_information.COLLEGEADDRESSZIPID";
          COLLEGEADDRESSPROVINCEID = "student_personal_information.COLLEGEADDRESSPROVINCEID";
          COLLEGEADDRESSREGIONID = "student_personal_information.COLLEGEADDRESSREGIONID";
          COLLEGEADDRESSCOUNTRYID = "student_personal_information.COLLEGEADDRESSCOUNTRYID";
          TELEPHONENUMBER = "student_personal_information.TELEPHONENUMBER";
          CELLULARPHONENUMBER = "student_personal_information.CELLULARPHONENUMBER";
          EMAIL = "student_personal_information.EMAIL";
          HIGHSCHOOL = "student_personal_information.HIGHSCHOOL";
          HIGHSCHOOLGRADE = "student_personal_information.HIGHSCHOOLGRADE";
          FATHERFIRSTNAME = "student_personal_information.FATHERFIRSTNAME";
          FATHERMIDDLENAME = "student_personal_information.FATHERMIDDLENAME";
          FATHERLASTNAME = "student_personal_information.FATHERLASTNAME";
          MOTHERFIRSTNAME = "student_personal_information.MOTHERFIRSTNAME";
          MOTHERMIDDLENAME = "student_personal_information.MOTHERMIDDLENAME";
          MOTHERLASTNAME = "student_personal_information.MOTHERLASTNAME";
          GUARDIANFIRSTNAME = "student_personal_information.GUARDIANFIRSTNAME";
          GUARDIANMIDDLENAME = "student_personal_information.GUARDIANMIDDLENAME";
          GUARDIANLASTNAME = "student_personal_information.GUARDIANLASTNAME";
          GUARDIANADDRESS = "student_personal_information.GUARDIANADDRESS";
          GUARDIANADDRESSZIPID = "student_personal_information.GUARDIANADDRESSZIPID";
          GUARDIANADDRESSPROVINCEID = "student_personal_information.GUARDIANADDRESSPROVINCEID";
          GUARDIANADDRESSREGIONID = "student_personal_information.GUARDIANADDRESSREGIONID";
          GUARDIANADDRESSCOUNTRYID = "student_personal_information.GUARDIANADDRESSCOUNTRYID";
          GUARDIANCONTACTNUMBER = "student_personal_information.GUARDIANCONTACTNUMBER";
          GUARDIANRELATION = "student_personal_information.GUARDIANRELATION";
          GUARDIANEMAIL = "student_personal_information.GUARDIANEMAIL";
          if (Torque.isInit())
        {
            try
            {
                getMapBuilder(StudentPersonalInformationMapBuilder.CLASS_NAME);
            }
            catch (Exception e)
            {
                log.error("Could not initialize Peer", e);
            }
        }
        else
        {
            Torque.registerMapBuilder(StudentPersonalInformationMapBuilder.CLASS_NAME);
        }
    }
 
    /** number of columns for this peer */
    public static final int numColumns =  38;

    /** A class that can be returned by this peer. */
    protected static final String CLASSNAME_DEFAULT =
        "dao.StudentPersonalInformation";

    /** A class that can be returned by this peer. */
    protected static final Class CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT);

    /**
     * Class object initialization method.
     *
     * @param className name of the class to initialize
     * @return the initialized class
     */
    private static Class initClass(String className)
    {
        Class c = null;
        try
        {
            c = Class.forName(className);
        }
        catch (Throwable t)
        {
            log.error("A FATAL ERROR has occurred which should not "
                + "have happened under any circumstance.  Please notify "
                + "the Torque developers <torque-dev@db.apache.org> "
                + "and give as many details as possible (including the error "
                + "stack trace).", t);

            // Error objects should always be propogated.
            if (t instanceof Error)
            {
                throw (Error) t.fillInStackTrace();
            }
        }
        return c;
    }

    /**
     * Get the list of objects for a ResultSet.  Please not that your
     * resultset MUST return columns in the right order.  You can use
     * getFieldNames() in BaseObject to get the correct sequence.
     *
     * @param results the ResultSet
     * @return the list of objects
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static List resultSet2Objects(java.sql.ResultSet results)
            throws TorqueException
    {
        try
        {
            QueryDataSet qds = null;
            List rows = null;
            try
            {
                qds = new QueryDataSet(results);
                rows = getSelectResults(qds);
            }
            finally
            {
                if (qds != null)
                {
                    qds.close();
                }
            }

            return populateObjects(rows);
        }
        catch (SQLException e)
        {
            throw new TorqueException(e);
        }
        catch (DataSetException e)
        {
            throw new TorqueException(e);
        }
    }


  
    /**
     * Method to do inserts.
     *
     * @param criteria object used to create the INSERT statement.
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static ObjectKey doInsert(Criteria criteria)
        throws TorqueException
    {
        return BaseStudentPersonalInformationPeer
            .doInsert(criteria, (Connection) null);
    }

    /**
     * Method to do inserts.  This method is to be used during a transaction,
     * otherwise use the doInsert(Criteria) method.  It will take care of
     * the connection details internally.
     *
     * @param criteria object used to create the INSERT statement.
     * @param con the connection to use
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static ObjectKey doInsert(Criteria criteria, Connection con)
        throws TorqueException
    {
                                                                                                                                                                                                                                      
        // Set the correct dbName if it has not been overridden
        // criteria.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (criteria.getDbName() == Torque.getDefaultDB())
        {
            criteria.setDbName(DATABASE_NAME);
        }
        if (con == null)
        {
            return BasePeer.doInsert(criteria);
        }
        else
        {
            return BasePeer.doInsert(criteria, con);
        }
    }

    /**
     * Add all the columns needed to create a new object.
     *
     * @param criteria object containing the columns to add.
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static void addSelectColumns(Criteria criteria)
            throws TorqueException
    {
          criteria.addSelectColumn(STUDENTPERSONALINFORMATIONID);
          criteria.addSelectColumn(STUDENTID);
          criteria.addSelectColumn(SEX);
          criteria.addSelectColumn(BIRTHDATE);
          criteria.addSelectColumn(CIVILSTATUS);
          criteria.addSelectColumn(CITIZENSHIP);
          criteria.addSelectColumn(RESIDENTIALADDRESS);
          criteria.addSelectColumn(RESIDENTIALADDRESSZIPID);
          criteria.addSelectColumn(RESIDENTIALADDRESSPROVINCEID);
          criteria.addSelectColumn(RESIDENTIALADDRESSREGIONID);
          criteria.addSelectColumn(RESIDENTIALADDRESSCOUNTRYID);
          criteria.addSelectColumn(COLLEGEADDRESS);
          criteria.addSelectColumn(COLLEGEADDRESSZIPID);
          criteria.addSelectColumn(COLLEGEADDRESSPROVINCEID);
          criteria.addSelectColumn(COLLEGEADDRESSREGIONID);
          criteria.addSelectColumn(COLLEGEADDRESSCOUNTRYID);
          criteria.addSelectColumn(TELEPHONENUMBER);
          criteria.addSelectColumn(CELLULARPHONENUMBER);
          criteria.addSelectColumn(EMAIL);
          criteria.addSelectColumn(HIGHSCHOOL);
          criteria.addSelectColumn(HIGHSCHOOLGRADE);
          criteria.addSelectColumn(FATHERFIRSTNAME);
          criteria.addSelectColumn(FATHERMIDDLENAME);
          criteria.addSelectColumn(FATHERLASTNAME);
          criteria.addSelectColumn(MOTHERFIRSTNAME);
          criteria.addSelectColumn(MOTHERMIDDLENAME);
          criteria.addSelectColumn(MOTHERLASTNAME);
          criteria.addSelectColumn(GUARDIANFIRSTNAME);
          criteria.addSelectColumn(GUARDIANMIDDLENAME);
          criteria.addSelectColumn(GUARDIANLASTNAME);
          criteria.addSelectColumn(GUARDIANADDRESS);
          criteria.addSelectColumn(GUARDIANADDRESSZIPID);
          criteria.addSelectColumn(GUARDIANADDRESSPROVINCEID);
          criteria.addSelectColumn(GUARDIANADDRESSREGIONID);
          criteria.addSelectColumn(GUARDIANADDRESSCOUNTRYID);
          criteria.addSelectColumn(GUARDIANCONTACTNUMBER);
          criteria.addSelectColumn(GUARDIANRELATION);
          criteria.addSelectColumn(GUARDIANEMAIL);
      }

    /**
     * Create a new object of type cls from a resultset row starting
     * from a specified offset.  This is done so that you can select
     * other rows than just those needed for this object.  You may
     * for example want to create two objects from the same row.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static StudentPersonalInformation row2Object(Record row,
                                             int offset,
                                             Class cls)
        throws TorqueException
    {
        try
        {
            StudentPersonalInformation obj = (StudentPersonalInformation) cls.newInstance();
            StudentPersonalInformationPeer.populateObject(row, offset, obj);
                  obj.setModified(false);
              obj.setNew(false);

            return obj;
        }
        catch (InstantiationException e)
        {
            throw new TorqueException(e);
        }
        catch (IllegalAccessException e)
        {
            throw new TorqueException(e);
        }
    }

    /**
     * Populates an object from a resultset row starting
     * from a specified offset.  This is done so that you can select
     * other rows than just those needed for this object.  You may
     * for example want to create two objects from the same row.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static void populateObject(Record row,
                                      int offset,
                                      StudentPersonalInformation obj)
        throws TorqueException
    {
        try
        {
                obj.setStudentpersonalinformationid(row.getValue(offset + 0).asInt());
                  obj.setStudentid(row.getValue(offset + 1).asInt());
                  obj.setSex(row.getValue(offset + 2).asString());
                  obj.setBirthdate(row.getValue(offset + 3).asUtilDate());
                  obj.setCivilstatus(row.getValue(offset + 4).asString());
                  obj.setCitizenship(row.getValue(offset + 5).asString());
                  obj.setResidentialaddress(row.getValue(offset + 6).asString());
                  obj.setResidentialaddresszipid(row.getValue(offset + 7).asInt());
                  obj.setResidentialaddressprovinceid(row.getValue(offset + 8).asInt());
                  obj.setResidentialaddressregionid(row.getValue(offset + 9).asInt());
                  obj.setResidentialaddresscountryid(row.getValue(offset + 10).asInt());
                  obj.setCollegeaddress(row.getValue(offset + 11).asString());
                  obj.setCollegeaddresszipid(row.getValue(offset + 12).asInt());
                  obj.setCollegeaddressprovinceid(row.getValue(offset + 13).asInt());
                  obj.setCollegeaddressregionid(row.getValue(offset + 14).asInt());
                  obj.setCollegeaddresscountryid(row.getValue(offset + 15).asInt());
                  obj.setTelephonenumber(row.getValue(offset + 16).asString());
                  obj.setCellularphonenumber(row.getValue(offset + 17).asString());
                  obj.setEmail(row.getValue(offset + 18).asString());
                  obj.setHighschool(row.getValue(offset + 19).asString());
                  obj.setHighschoolgrade(row.getValue(offset + 20).asDouble());
                  obj.setFatherfirstname(row.getValue(offset + 21).asString());
                  obj.setFathermiddlename(row.getValue(offset + 22).asString());
                  obj.setFatherlastname(row.getValue(offset + 23).asString());
                  obj.setMotherfirstname(row.getValue(offset + 24).asString());
                  obj.setMothermiddlename(row.getValue(offset + 25).asString());
                  obj.setMotherlastname(row.getValue(offset + 26).asString());
                  obj.setGuardianfirstname(row.getValue(offset + 27).asString());
                  obj.setGuardianmiddlename(row.getValue(offset + 28).asString());
                  obj.setGuardianlastname(row.getValue(offset + 29).asString());
                  obj.setGuardianaddress(row.getValue(offset + 30).asString());
                  obj.setGuardianaddresszipid(row.getValue(offset + 31).asInt());
                  obj.setGuardianaddressprovinceid(row.getValue(offset + 32).asInt());
                  obj.setGuardianaddressregionid(row.getValue(offset + 33).asInt());
                  obj.setGuardianaddresscountryid(row.getValue(offset + 34).asInt());
                  obj.setGuardiancontactnumber(row.getValue(offset + 35).asString());
                  obj.setGuardianrelation(row.getValue(offset + 36).asString());
                  obj.setGuardianemail(row.getValue(offset + 37).asString());
              }
        catch (DataSetException e)
        {
            throw new TorqueException(e);
        }
    }

    /**
     * Method to do selects.
     *
     * @param criteria object used to create the SELECT statement.
     * @return List of selected Objects
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static List doSelect(Criteria criteria) throws TorqueException
    {
        return populateObjects(doSelectVillageRecords(criteria));
    }

    /**
     * Method to do selects within a transaction.
     *
     * @param criteria object used to create the SELECT statement.
     * @param con the connection to use
     * @return List of selected Objects
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static List doSelect(Criteria criteria, Connection con)
        throws TorqueException
    {
        return populateObjects(doSelectVillageRecords(criteria, con));
    }

    /**
     * Grabs the raw Village records to be formed into objects.
     * This method handles connections internally.  The Record objects
     * returned by this method should be considered readonly.  Do not
     * alter the data and call save(), your results may vary, but are
     * certainly likely to result in hard to track MT bugs.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static List doSelectVillageRecords(Criteria criteria)
        throws TorqueException
    {
        return BaseStudentPersonalInformationPeer
            .doSelectVillageRecords(criteria, (Connection) null);
    }

    /**
     * Grabs the raw Village records to be formed into objects.
     * This method should be used for transactions
     *
     * @param con the connection to use
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static List doSelectVillageRecords(Criteria criteria, Connection con)
        throws TorqueException
    {
        if (criteria.getSelectColumns().size() == 0)
        {
            addSelectColumns(criteria);
        }

                                                                                                                                                                                                                                      
        // Set the correct dbName if it has not been overridden
        // criteria.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (criteria.getDbName() == Torque.getDefaultDB())
        {
            criteria.setDbName(DATABASE_NAME);
        }
        // BasePeer returns a List of Value (Village) arrays.  The array
        // order follows the order columns were placed in the Select clause.
        if (con == null)
        {
            return BasePeer.doSelect(criteria);
        }
        else
        {
            return BasePeer.doSelect(criteria, con);
        }
    }

    /**
     * The returned List will contain objects of the default type or
     * objects that inherit from the default.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static List populateObjects(List records)
        throws TorqueException
    {
        List results = new ArrayList(records.size());

        // populate the object(s)
        for (int i = 0; i < records.size(); i++)
        {
            Record row = (Record) records.get(i);
              results.add(StudentPersonalInformationPeer.row2Object(row, 1,
                StudentPersonalInformationPeer.getOMClass()));
          }
        return results;
    }
 

    /**
     * The class that the Peer will make instances of.
     * If the BO is abstract then you must implement this method
     * in the BO.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static Class getOMClass()
        throws TorqueException
    {
        return CLASS_DEFAULT;
    }

    /**
     * Method to do updates.
     *
     * @param criteria object containing data that is used to create the UPDATE
     *        statement.
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static void doUpdate(Criteria criteria) throws TorqueException
    {
         BaseStudentPersonalInformationPeer
            .doUpdate(criteria, (Connection) null);
    }

    /**
     * Method to do updates.  This method is to be used during a transaction,
     * otherwise use the doUpdate(Criteria) method.  It will take care of
     * the connection details internally.
     *
     * @param criteria object containing data that is used to create the UPDATE
     *        statement.
     * @param con the connection to use
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static void doUpdate(Criteria criteria, Connection con)
        throws TorqueException
    {
        Criteria selectCriteria = new Criteria(DATABASE_NAME, 2);
                   selectCriteria.put(STUDENTPERSONALINFORMATIONID, criteria.remove(STUDENTPERSONALINFORMATIONID));
                                                                                                                                                                                                                                                                                                                                                                                        
        // Set the correct dbName if it has not been overridden
        // criteria.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (criteria.getDbName() == Torque.getDefaultDB())
        {
            criteria.setDbName(DATABASE_NAME);
        }
        if (con == null)
        {
            BasePeer.doUpdate(selectCriteria, criteria);
        }
        else
        {
            BasePeer.doUpdate(selectCriteria, criteria, con);
        }
    }

    /**
     * Method to do deletes.
     *
     * @param criteria object containing data that is used DELETE from database.
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
     public static void doDelete(Criteria criteria) throws TorqueException
     {
         BaseStudentPersonalInformationPeer
            .doDelete(criteria, (Connection) null);
     }

    /**
     * Method to do deletes.  This method is to be used during a transaction,
     * otherwise use the doDelete(Criteria) method.  It will take care of
     * the connection details internally.
     *
     * @param criteria object containing data that is used DELETE from database.
     * @param con the connection to use
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
     public static void doDelete(Criteria criteria, Connection con)
        throws TorqueException
     {
                                                                                                                                                                                                                                      
        // Set the correct dbName if it has not been overridden
        // criteria.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (criteria.getDbName() == Torque.getDefaultDB())
        {
            criteria.setDbName(DATABASE_NAME);
        }
        if (con == null)
        {
            BasePeer.doDelete(criteria);
        }
        else
        {
            BasePeer.doDelete(criteria, con);
        }
     }

    /**
     * Method to do selects
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static List doSelect(StudentPersonalInformation obj) throws TorqueException
    {
        return doSelect(buildCriteria(obj));
    }

    /**
     * Method to do inserts
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static void doInsert(StudentPersonalInformation obj) throws TorqueException
    {
          obj.setPrimaryKey(doInsert(buildCriteria(obj)));
          obj.setNew(false);
        obj.setModified(false);
    }

    /**
     * @param obj the data object to update in the database.
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static void doUpdate(StudentPersonalInformation obj) throws TorqueException
    {
        doUpdate(buildCriteria(obj));
        obj.setModified(false);
    }

    /**
     * @param obj the data object to delete in the database.
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static void doDelete(StudentPersonalInformation obj) throws TorqueException
    {
        doDelete(buildCriteria(obj));
    }

    /**
     * Method to do inserts.  This method is to be used during a transaction,
     * otherwise use the doInsert(StudentPersonalInformation) method.  It will take
     * care of the connection details internally.
     *
     * @param obj the data object to insert into the database.
     * @param con the connection to use
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static void doInsert(StudentPersonalInformation obj, Connection con)
        throws TorqueException
    {
          obj.setPrimaryKey(doInsert(buildCriteria(obj), con));
          obj.setNew(false);
        obj.setModified(false);
    }

    /**
     * Method to do update.  This method is to be used during a transaction,
     * otherwise use the doUpdate(StudentPersonalInformation) method.  It will take
     * care of the connection details internally.
     *
     * @param obj the data object to update in the database.
     * @param con the connection to use
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static void doUpdate(StudentPersonalInformation obj, Connection con)
        throws TorqueException
    {
        doUpdate(buildCriteria(obj), con);
        obj.setModified(false);
    }

    /**
     * Method to delete.  This method is to be used during a transaction,
     * otherwise use the doDelete(StudentPersonalInformation) method.  It will take
     * care of the connection details internally.
     *
     * @param obj the data object to delete in the database.
     * @param con the connection to use
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static void doDelete(StudentPersonalInformation obj, Connection con)
        throws TorqueException
    {
        doDelete(buildCriteria(obj), con);
    }

    /**
     * Method to do deletes.
     *
     * @param pk ObjectKey that is used DELETE from database.
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static void doDelete(ObjectKey pk) throws TorqueException
    {
        BaseStudentPersonalInformationPeer
           .doDelete(pk, (Connection) null);
    }

    /**
     * Method to delete.  This method is to be used during a transaction,
     * otherwise use the doDelete(ObjectKey) method.  It will take
     * care of the connection details internally.
     *
     * @param pk the primary key for the object to delete in the database.
     * @param con the connection to use
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static void doDelete(ObjectKey pk, Connection con)
        throws TorqueException
    {
        doDelete(buildCriteria(pk), con);
    }

    /** Build a Criteria object from an ObjectKey */
    public static Criteria buildCriteria( ObjectKey pk )
    {
        Criteria criteria = new Criteria();
              criteria.add(STUDENTPERSONALINFORMATIONID, pk);
          return criteria;
     }

    /** Build a Criteria object from the data object for this peer */
    public static Criteria buildCriteria( StudentPersonalInformation obj )
    {
        Criteria criteria = new Criteria(DATABASE_NAME);
              if (!obj.isNew())
                criteria.add(STUDENTPERSONALINFORMATIONID, obj.getStudentpersonalinformationid());
                  criteria.add(STUDENTID, obj.getStudentid());
                  criteria.add(SEX, obj.getSex());
                  criteria.add(BIRTHDATE, obj.getBirthdate());
                  criteria.add(CIVILSTATUS, obj.getCivilstatus());
                  criteria.add(CITIZENSHIP, obj.getCitizenship());
                  criteria.add(RESIDENTIALADDRESS, obj.getResidentialaddress());
                  criteria.add(RESIDENTIALADDRESSZIPID, obj.getResidentialaddresszipid());
                  criteria.add(RESIDENTIALADDRESSPROVINCEID, obj.getResidentialaddressprovinceid());
                  criteria.add(RESIDENTIALADDRESSREGIONID, obj.getResidentialaddressregionid());
                  criteria.add(RESIDENTIALADDRESSCOUNTRYID, obj.getResidentialaddresscountryid());
                  criteria.add(COLLEGEADDRESS, obj.getCollegeaddress());
                  criteria.add(COLLEGEADDRESSZIPID, obj.getCollegeaddresszipid());
                  criteria.add(COLLEGEADDRESSPROVINCEID, obj.getCollegeaddressprovinceid());
                  criteria.add(COLLEGEADDRESSREGIONID, obj.getCollegeaddressregionid());
                  criteria.add(COLLEGEADDRESSCOUNTRYID, obj.getCollegeaddresscountryid());
                  criteria.add(TELEPHONENUMBER, obj.getTelephonenumber());
                  criteria.add(CELLULARPHONENUMBER, obj.getCellularphonenumber());
                  criteria.add(EMAIL, obj.getEmail());
                  criteria.add(HIGHSCHOOL, obj.getHighschool());
                  criteria.add(HIGHSCHOOLGRADE, obj.getHighschoolgrade());
                  criteria.add(FATHERFIRSTNAME, obj.getFatherfirstname());
                  criteria.add(FATHERMIDDLENAME, obj.getFathermiddlename());
                  criteria.add(FATHERLASTNAME, obj.getFatherlastname());
                  criteria.add(MOTHERFIRSTNAME, obj.getMotherfirstname());
                  criteria.add(MOTHERMIDDLENAME, obj.getMothermiddlename());
                  criteria.add(MOTHERLASTNAME, obj.getMotherlastname());
                  criteria.add(GUARDIANFIRSTNAME, obj.getGuardianfirstname());
                  criteria.add(GUARDIANMIDDLENAME, obj.getGuardianmiddlename());
                  criteria.add(GUARDIANLASTNAME, obj.getGuardianlastname());
                  criteria.add(GUARDIANADDRESS, obj.getGuardianaddress());
                  criteria.add(GUARDIANADDRESSZIPID, obj.getGuardianaddresszipid());
                  criteria.add(GUARDIANADDRESSPROVINCEID, obj.getGuardianaddressprovinceid());
                  criteria.add(GUARDIANADDRESSREGIONID, obj.getGuardianaddressregionid());
                  criteria.add(GUARDIANADDRESSCOUNTRYID, obj.getGuardianaddresscountryid());
                  criteria.add(GUARDIANCONTACTNUMBER, obj.getGuardiancontactnumber());
                  criteria.add(GUARDIANRELATION, obj.getGuardianrelation());
                  criteria.add(GUARDIANEMAIL, obj.getGuardianemail());
          return criteria;
    }
 
    
        /**
     * Retrieve a single object by pk
     *
     * @param pk the primary key
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     * @throws NoRowsException Primary key was not found in database.
     * @throws TooManyRowsException Primary key was not found in database.
     */
    public static StudentPersonalInformation retrieveByPK(int pk)
        throws TorqueException, NoRowsException, TooManyRowsException
    {
        return retrieveByPK(SimpleKey.keyFor(pk));
    }
  
    /**
     * Retrieve a single object by pk
     *
     * @param pk the primary key
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     * @throws NoRowsException Primary key was not found in database.
     * @throws TooManyRowsException Primary key was not found in database.
     */
    public static StudentPersonalInformation retrieveByPK(ObjectKey pk)
        throws TorqueException, NoRowsException, TooManyRowsException
    {
        Connection db = null;
        StudentPersonalInformation retVal = null;
        try
        {
            db = Torque.getConnection(DATABASE_NAME);
            retVal = retrieveByPK(pk, db);
        }
        finally
        {
            Torque.closeConnection(db);
        }
        return(retVal);
    }

    /**
     * Retrieve a single object by pk
     *
     * @param pk the primary key
     * @param con the connection to use
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     * @throws NoRowsException Primary key was not found in database.
     * @throws TooManyRowsException Primary key was not found in database.
     */
    public static StudentPersonalInformation retrieveByPK(ObjectKey pk, Connection con)
        throws TorqueException, NoRowsException, TooManyRowsException
    {
        Criteria criteria = buildCriteria(pk);
        List v = doSelect(criteria, con);
        if (v.size() == 0)
        {
            throw new NoRowsException("Failed to select a row.");
        }
        else if (v.size() > 1)
        {
            throw new TooManyRowsException("Failed to select only one row.");
        }
        else
        {
            return (StudentPersonalInformation)v.get(0);
        }
    }

    /**
     * Retrieve a multiple objects by pk
     *
     * @param pks List of primary keys
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static List retrieveByPKs(List pks)
        throws TorqueException
    {
        Connection db = null;
        List retVal = null;
        try
        {
           db = Torque.getConnection(DATABASE_NAME);
           retVal = retrieveByPKs(pks, db);
        }
        finally
        {
            Torque.closeConnection(db);
        }
        return(retVal);
    }

    /**
     * Retrieve a multiple objects by pk
     *
     * @param pks List of primary keys
     * @param dbcon the connection to use
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static List retrieveByPKs( List pks, Connection dbcon )
        throws TorqueException
    {
        List objs = null;
        if (pks == null || pks.size() == 0)
        {
            objs = new LinkedList();
        }
        else
        {
            Criteria criteria = new Criteria();
              criteria.addIn( STUDENTPERSONALINFORMATIONID, pks );
          objs = doSelect(criteria, dbcon);
        }
        return objs;
    }

 



                                  
                                              
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Student objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinStudent(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        StudentPeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.STUDENTID,
            StudentPeer.STUDENTID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = StudentPeer.getOMClass();
                    Student obj2 = (Student)StudentPeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                                                                      
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Zip objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinZipRelatedByResidentialaddresszipid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        ZipPeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.RESIDENTIALADDRESSZIPID,
            ZipPeer.ZIPID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = ZipPeer.getOMClass();
                    Zip obj2 = (Zip)ZipPeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj2 = (Zip)temp_obj1.getZipRelatedByResidentialaddresszipid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByResidentialaddresszipid();
                obj2.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                                                                      
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Province objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinProvinceRelatedByResidentialaddressprovinceid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        ProvincePeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.RESIDENTIALADDRESSPROVINCEID,
            ProvincePeer.PROVINCEID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = ProvincePeer.getOMClass();
                    Province obj2 = (Province)ProvincePeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj2 = (Province)temp_obj1.getProvinceRelatedByResidentialaddressprovinceid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByResidentialaddressprovinceid();
                obj2.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                                                                      
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Region objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinRegionRelatedByResidentialaddressregionid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        RegionPeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.RESIDENTIALADDRESSREGIONID,
            RegionPeer.REGIONID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = RegionPeer.getOMClass();
                    Region obj2 = (Region)RegionPeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj2 = (Region)temp_obj1.getRegionRelatedByResidentialaddressregionid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByResidentialaddressregionid();
                obj2.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                                                                      
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Country objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinCountryRelatedByResidentialaddresscountryid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        CountryPeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.RESIDENTIALADDRESSCOUNTRYID,
            CountryPeer.COUNTRYID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = CountryPeer.getOMClass();
                    Country obj2 = (Country)CountryPeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj2 = (Country)temp_obj1.getCountryRelatedByResidentialaddresscountryid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByResidentialaddresscountryid();
                obj2.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                                                                      
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Zip objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinZipRelatedByCollegeaddresszipid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        ZipPeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.COLLEGEADDRESSZIPID,
            ZipPeer.ZIPID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = ZipPeer.getOMClass();
                    Zip obj2 = (Zip)ZipPeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj2 = (Zip)temp_obj1.getZipRelatedByCollegeaddresszipid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByCollegeaddresszipid();
                obj2.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                                                                      
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Province objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinProvinceRelatedByCollegeaddressprovinceid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        ProvincePeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.COLLEGEADDRESSPROVINCEID,
            ProvincePeer.PROVINCEID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = ProvincePeer.getOMClass();
                    Province obj2 = (Province)ProvincePeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj2 = (Province)temp_obj1.getProvinceRelatedByCollegeaddressprovinceid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByCollegeaddressprovinceid();
                obj2.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                                                                      
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Region objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinRegionRelatedByCollegeaddressregionid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        RegionPeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.COLLEGEADDRESSREGIONID,
            RegionPeer.REGIONID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = RegionPeer.getOMClass();
                    Region obj2 = (Region)RegionPeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj2 = (Region)temp_obj1.getRegionRelatedByCollegeaddressregionid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByCollegeaddressregionid();
                obj2.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                                                                      
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Country objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinCountryRelatedByCollegeaddresscountryid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        CountryPeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.COLLEGEADDRESSCOUNTRYID,
            CountryPeer.COUNTRYID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = CountryPeer.getOMClass();
                    Country obj2 = (Country)CountryPeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj2 = (Country)temp_obj1.getCountryRelatedByCollegeaddresscountryid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByCollegeaddresscountryid();
                obj2.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                                                                      
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Zip objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinZipRelatedByGuardianaddresszipid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        ZipPeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.GUARDIANADDRESSZIPID,
            ZipPeer.ZIPID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = ZipPeer.getOMClass();
                    Zip obj2 = (Zip)ZipPeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj2 = (Zip)temp_obj1.getZipRelatedByGuardianaddresszipid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByGuardianaddresszipid();
                obj2.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                                                                      
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Province objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinProvinceRelatedByGuardianaddressprovinceid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        ProvincePeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.GUARDIANADDRESSPROVINCEID,
            ProvincePeer.PROVINCEID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = ProvincePeer.getOMClass();
                    Province obj2 = (Province)ProvincePeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj2 = (Province)temp_obj1.getProvinceRelatedByGuardianaddressprovinceid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByGuardianaddressprovinceid();
                obj2.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                                                                      
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Region objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinRegionRelatedByGuardianaddressregionid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        RegionPeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.GUARDIANADDRESSREGIONID,
            RegionPeer.REGIONID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = RegionPeer.getOMClass();
                    Region obj2 = (Region)RegionPeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj2 = (Region)temp_obj1.getRegionRelatedByGuardianaddressregionid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByGuardianaddressregionid();
                obj2.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                                                                      
                
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with their
     * Country objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinCountryRelatedByGuardianaddresscountryid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        StudentPersonalInformationPeer.addSelectColumns(c);
        int offset = numColumns + 1;
        CountryPeer.addSelectColumns(c);


                        c.addJoin(StudentPersonalInformationPeer.GUARDIANADDRESSCOUNTRYID,
            CountryPeer.COUNTRYID);
        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record) rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation) StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                     omClass = CountryPeer.getOMClass();
                    Country obj2 = (Country)CountryPeer
                .row2Object(row, offset, omClass);

            boolean newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj2 = (Country)temp_obj1.getCountryRelatedByGuardianaddresscountryid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByGuardianaddresscountryid();
                obj2.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
            }
            results.add(obj1);
        }
        return results;
    }
                    
  
                                                                                                                                        
          
        
                                  
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptStudent(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                                                  
                    ZipPeer.addSelectColumns(c);
        int offset3 = offset2 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset4 = offset3 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset5 = offset4 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset6 = offset5 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset7 = offset6 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset8 = offset7 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset9 = offset8 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset10 = offset9 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset11 = offset10 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset12 = offset11 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset13 = offset12 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset14 = offset13 + CountryPeer.numColumns;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                                  
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj2 = (Zip)ZipPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj2 = (Zip)temp_obj1.getZipRelatedByResidentialaddresszipid();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformationsRelatedByResidentialaddresszipid();
                obj2.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj3 = (Province)ProvincePeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj3 = (Province)temp_obj1.getProvinceRelatedByResidentialaddressprovinceid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddressprovinceid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj4 = (Region)RegionPeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj4 = (Region)temp_obj1.getRegionRelatedByResidentialaddressregionid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressregionid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj5 = (Country)CountryPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj5 = (Country)temp_obj1.getCountryRelatedByResidentialaddresscountryid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddresscountryid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj6 = (Zip)ZipPeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj6 = (Zip)temp_obj1.getZipRelatedByCollegeaddresszipid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddresszipid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj7 = (Province)ProvincePeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj7 = (Province)temp_obj1.getProvinceRelatedByCollegeaddressprovinceid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressprovinceid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj8 = (Region)RegionPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj8 = (Region)temp_obj1.getRegionRelatedByCollegeaddressregionid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddressregionid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj9 = (Country)CountryPeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj9 = (Country)temp_obj1.getCountryRelatedByCollegeaddresscountryid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByCollegeaddresscountryid();
                obj9.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj10 = (Zip)ZipPeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj10 = (Zip)temp_obj1.getZipRelatedByGuardianaddresszipid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddresszipid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj11 = (Province)ProvincePeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj11 = (Province)temp_obj1.getProvinceRelatedByGuardianaddressprovinceid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddressprovinceid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj12 = (Region)RegionPeer
                .row2Object( row, offset12, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj12 = (Region)temp_obj1.getRegionRelatedByGuardianaddressregionid();
                if (temp_obj12.getPrimaryKey().equals(obj12.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj12.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj12.initStudentPersonalInformationsRelatedByGuardianaddressregionid();
                obj12.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj13 = (Country)CountryPeer
                .row2Object( row, offset13, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj13 = (Country)temp_obj1.getCountryRelatedByGuardianaddresscountryid();
                if (temp_obj13.getPrimaryKey().equals(obj13.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj13.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj13.initStudentPersonalInformationsRelatedByGuardianaddresscountryid();
                obj13.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
            }
                                                results.add(obj1);
        }
        return results;
    }
        
        
                                            
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptZipRelatedByResidentialaddresszipid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                    StudentPeer.addSelectColumns(c);
        int offset3 = offset2 + StudentPeer.numColumns;
                                                                
                                                  
                    ProvincePeer.addSelectColumns(c);
        int offset4 = offset3 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset5 = offset4 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset6 = offset5 + CountryPeer.numColumns;
                                                                
                                                  
                    ProvincePeer.addSelectColumns(c);
        int offset7 = offset6 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset8 = offset7 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset9 = offset8 + CountryPeer.numColumns;
                                                                
                                                  
                    ProvincePeer.addSelectColumns(c);
        int offset10 = offset9 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset11 = offset10 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset12 = offset11 + CountryPeer.numColumns;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                        
                            
              
                           omClass = StudentPeer.getOMClass();
                          Student obj2 = (Student)StudentPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj3 = (Province)ProvincePeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj3 = (Province)temp_obj1.getProvinceRelatedByResidentialaddressprovinceid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddressprovinceid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj4 = (Region)RegionPeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj4 = (Region)temp_obj1.getRegionRelatedByResidentialaddressregionid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressregionid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj5 = (Country)CountryPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj5 = (Country)temp_obj1.getCountryRelatedByResidentialaddresscountryid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddresscountryid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj6 = (Province)ProvincePeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj6 = (Province)temp_obj1.getProvinceRelatedByCollegeaddressprovinceid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddressprovinceid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj7 = (Region)RegionPeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj7 = (Region)temp_obj1.getRegionRelatedByCollegeaddressregionid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressregionid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj8 = (Country)CountryPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj8 = (Country)temp_obj1.getCountryRelatedByCollegeaddresscountryid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddresscountryid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj9 = (Province)ProvincePeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj9 = (Province)temp_obj1.getProvinceRelatedByGuardianaddressprovinceid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByGuardianaddressprovinceid();
                obj9.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj10 = (Region)RegionPeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj10 = (Region)temp_obj1.getRegionRelatedByGuardianaddressregionid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddressregionid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj11 = (Country)CountryPeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj11 = (Country)temp_obj1.getCountryRelatedByGuardianaddresscountryid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddresscountryid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
            }
                                                results.add(obj1);
        }
        return results;
    }
        
        
                                            
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptProvinceRelatedByResidentialaddressprovinceid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                    StudentPeer.addSelectColumns(c);
        int offset3 = offset2 + StudentPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset4 = offset3 + ZipPeer.numColumns;
                                                                
                                                  
                    RegionPeer.addSelectColumns(c);
        int offset5 = offset4 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset6 = offset5 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset7 = offset6 + ZipPeer.numColumns;
                                                                
                                                  
                    RegionPeer.addSelectColumns(c);
        int offset8 = offset7 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset9 = offset8 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset10 = offset9 + ZipPeer.numColumns;
                                                                
                                                  
                    RegionPeer.addSelectColumns(c);
        int offset11 = offset10 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset12 = offset11 + CountryPeer.numColumns;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                        
                            
              
                           omClass = StudentPeer.getOMClass();
                          Student obj2 = (Student)StudentPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj3 = (Zip)ZipPeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj3 = (Zip)temp_obj1.getZipRelatedByResidentialaddresszipid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddresszipid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj4 = (Region)RegionPeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj4 = (Region)temp_obj1.getRegionRelatedByResidentialaddressregionid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressregionid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj5 = (Country)CountryPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj5 = (Country)temp_obj1.getCountryRelatedByResidentialaddresscountryid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddresscountryid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj6 = (Zip)ZipPeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj6 = (Zip)temp_obj1.getZipRelatedByCollegeaddresszipid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddresszipid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj7 = (Region)RegionPeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj7 = (Region)temp_obj1.getRegionRelatedByCollegeaddressregionid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressregionid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj8 = (Country)CountryPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj8 = (Country)temp_obj1.getCountryRelatedByCollegeaddresscountryid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddresscountryid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj9 = (Zip)ZipPeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj9 = (Zip)temp_obj1.getZipRelatedByGuardianaddresszipid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByGuardianaddresszipid();
                obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj10 = (Region)RegionPeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj10 = (Region)temp_obj1.getRegionRelatedByGuardianaddressregionid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddressregionid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj11 = (Country)CountryPeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj11 = (Country)temp_obj1.getCountryRelatedByGuardianaddresscountryid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddresscountryid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
            }
                                                results.add(obj1);
        }
        return results;
    }
        
        
                                            
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptRegionRelatedByResidentialaddressregionid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                    StudentPeer.addSelectColumns(c);
        int offset3 = offset2 + StudentPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset4 = offset3 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset5 = offset4 + ProvincePeer.numColumns;
                                                                
                                                  
                    CountryPeer.addSelectColumns(c);
        int offset6 = offset5 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset7 = offset6 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset8 = offset7 + ProvincePeer.numColumns;
                                                                
                                                  
                    CountryPeer.addSelectColumns(c);
        int offset9 = offset8 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset10 = offset9 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset11 = offset10 + ProvincePeer.numColumns;
                                                                
                                                  
                    CountryPeer.addSelectColumns(c);
        int offset12 = offset11 + CountryPeer.numColumns;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                        
                            
              
                           omClass = StudentPeer.getOMClass();
                          Student obj2 = (Student)StudentPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj3 = (Zip)ZipPeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj3 = (Zip)temp_obj1.getZipRelatedByResidentialaddresszipid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddresszipid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj4 = (Province)ProvincePeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj4 = (Province)temp_obj1.getProvinceRelatedByResidentialaddressprovinceid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressprovinceid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj5 = (Country)CountryPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj5 = (Country)temp_obj1.getCountryRelatedByResidentialaddresscountryid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddresscountryid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj6 = (Zip)ZipPeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj6 = (Zip)temp_obj1.getZipRelatedByCollegeaddresszipid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddresszipid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj7 = (Province)ProvincePeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj7 = (Province)temp_obj1.getProvinceRelatedByCollegeaddressprovinceid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressprovinceid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj8 = (Country)CountryPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj8 = (Country)temp_obj1.getCountryRelatedByCollegeaddresscountryid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddresscountryid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj9 = (Zip)ZipPeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj9 = (Zip)temp_obj1.getZipRelatedByGuardianaddresszipid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByGuardianaddresszipid();
                obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj10 = (Province)ProvincePeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj10 = (Province)temp_obj1.getProvinceRelatedByGuardianaddressprovinceid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddressprovinceid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj11 = (Country)CountryPeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj11 = (Country)temp_obj1.getCountryRelatedByGuardianaddresscountryid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddresscountryid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
            }
                                                results.add(obj1);
        }
        return results;
    }
        
        
                                            
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptCountryRelatedByResidentialaddresscountryid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                    StudentPeer.addSelectColumns(c);
        int offset3 = offset2 + StudentPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset4 = offset3 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset5 = offset4 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset6 = offset5 + RegionPeer.numColumns;
                                                                
                                                  
                    ZipPeer.addSelectColumns(c);
        int offset7 = offset6 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset8 = offset7 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset9 = offset8 + RegionPeer.numColumns;
                                                                
                                                  
                    ZipPeer.addSelectColumns(c);
        int offset10 = offset9 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset11 = offset10 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset12 = offset11 + RegionPeer.numColumns;
                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                        
                            
              
                           omClass = StudentPeer.getOMClass();
                          Student obj2 = (Student)StudentPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj3 = (Zip)ZipPeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj3 = (Zip)temp_obj1.getZipRelatedByResidentialaddresszipid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddresszipid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj4 = (Province)ProvincePeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj4 = (Province)temp_obj1.getProvinceRelatedByResidentialaddressprovinceid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressprovinceid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj5 = (Region)RegionPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj5 = (Region)temp_obj1.getRegionRelatedByResidentialaddressregionid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddressregionid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj6 = (Zip)ZipPeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj6 = (Zip)temp_obj1.getZipRelatedByCollegeaddresszipid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddresszipid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj7 = (Province)ProvincePeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj7 = (Province)temp_obj1.getProvinceRelatedByCollegeaddressprovinceid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressprovinceid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj8 = (Region)RegionPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj8 = (Region)temp_obj1.getRegionRelatedByCollegeaddressregionid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddressregionid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj9 = (Zip)ZipPeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj9 = (Zip)temp_obj1.getZipRelatedByGuardianaddresszipid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByGuardianaddresszipid();
                obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj10 = (Province)ProvincePeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj10 = (Province)temp_obj1.getProvinceRelatedByGuardianaddressprovinceid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddressprovinceid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj11 = (Region)RegionPeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj11 = (Region)temp_obj1.getRegionRelatedByGuardianaddressregionid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddressregionid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
            }
                                                                    
                                              results.add(obj1);
        }
        return results;
    }
        
        
                                            
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptZipRelatedByCollegeaddresszipid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                    StudentPeer.addSelectColumns(c);
        int offset3 = offset2 + StudentPeer.numColumns;
                                                                
                                                  
                    ProvincePeer.addSelectColumns(c);
        int offset4 = offset3 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset5 = offset4 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset6 = offset5 + CountryPeer.numColumns;
                                                                
                                                  
                    ProvincePeer.addSelectColumns(c);
        int offset7 = offset6 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset8 = offset7 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset9 = offset8 + CountryPeer.numColumns;
                                                                
                                                  
                    ProvincePeer.addSelectColumns(c);
        int offset10 = offset9 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset11 = offset10 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset12 = offset11 + CountryPeer.numColumns;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                        
                            
              
                           omClass = StudentPeer.getOMClass();
                          Student obj2 = (Student)StudentPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj3 = (Province)ProvincePeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj3 = (Province)temp_obj1.getProvinceRelatedByResidentialaddressprovinceid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddressprovinceid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj4 = (Region)RegionPeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj4 = (Region)temp_obj1.getRegionRelatedByResidentialaddressregionid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressregionid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj5 = (Country)CountryPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj5 = (Country)temp_obj1.getCountryRelatedByResidentialaddresscountryid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddresscountryid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj6 = (Province)ProvincePeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj6 = (Province)temp_obj1.getProvinceRelatedByCollegeaddressprovinceid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddressprovinceid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj7 = (Region)RegionPeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj7 = (Region)temp_obj1.getRegionRelatedByCollegeaddressregionid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressregionid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj8 = (Country)CountryPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj8 = (Country)temp_obj1.getCountryRelatedByCollegeaddresscountryid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddresscountryid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj9 = (Province)ProvincePeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj9 = (Province)temp_obj1.getProvinceRelatedByGuardianaddressprovinceid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByGuardianaddressprovinceid();
                obj9.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj10 = (Region)RegionPeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj10 = (Region)temp_obj1.getRegionRelatedByGuardianaddressregionid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddressregionid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj11 = (Country)CountryPeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj11 = (Country)temp_obj1.getCountryRelatedByGuardianaddresscountryid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddresscountryid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
            }
                                                results.add(obj1);
        }
        return results;
    }
        
        
                                            
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptProvinceRelatedByCollegeaddressprovinceid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                    StudentPeer.addSelectColumns(c);
        int offset3 = offset2 + StudentPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset4 = offset3 + ZipPeer.numColumns;
                                                                
                                                  
                    RegionPeer.addSelectColumns(c);
        int offset5 = offset4 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset6 = offset5 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset7 = offset6 + ZipPeer.numColumns;
                                                                
                                                  
                    RegionPeer.addSelectColumns(c);
        int offset8 = offset7 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset9 = offset8 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset10 = offset9 + ZipPeer.numColumns;
                                                                
                                                  
                    RegionPeer.addSelectColumns(c);
        int offset11 = offset10 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset12 = offset11 + CountryPeer.numColumns;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                        
                            
              
                           omClass = StudentPeer.getOMClass();
                          Student obj2 = (Student)StudentPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj3 = (Zip)ZipPeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj3 = (Zip)temp_obj1.getZipRelatedByResidentialaddresszipid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddresszipid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj4 = (Region)RegionPeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj4 = (Region)temp_obj1.getRegionRelatedByResidentialaddressregionid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressregionid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj5 = (Country)CountryPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj5 = (Country)temp_obj1.getCountryRelatedByResidentialaddresscountryid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddresscountryid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj6 = (Zip)ZipPeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj6 = (Zip)temp_obj1.getZipRelatedByCollegeaddresszipid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddresszipid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj7 = (Region)RegionPeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj7 = (Region)temp_obj1.getRegionRelatedByCollegeaddressregionid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressregionid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj8 = (Country)CountryPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj8 = (Country)temp_obj1.getCountryRelatedByCollegeaddresscountryid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddresscountryid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj9 = (Zip)ZipPeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj9 = (Zip)temp_obj1.getZipRelatedByGuardianaddresszipid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByGuardianaddresszipid();
                obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj10 = (Region)RegionPeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj10 = (Region)temp_obj1.getRegionRelatedByGuardianaddressregionid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddressregionid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj11 = (Country)CountryPeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj11 = (Country)temp_obj1.getCountryRelatedByGuardianaddresscountryid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddresscountryid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
            }
                                                results.add(obj1);
        }
        return results;
    }
        
        
                                            
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptRegionRelatedByCollegeaddressregionid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                    StudentPeer.addSelectColumns(c);
        int offset3 = offset2 + StudentPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset4 = offset3 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset5 = offset4 + ProvincePeer.numColumns;
                                                                
                                                  
                    CountryPeer.addSelectColumns(c);
        int offset6 = offset5 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset7 = offset6 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset8 = offset7 + ProvincePeer.numColumns;
                                                                
                                                  
                    CountryPeer.addSelectColumns(c);
        int offset9 = offset8 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset10 = offset9 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset11 = offset10 + ProvincePeer.numColumns;
                                                                
                                                  
                    CountryPeer.addSelectColumns(c);
        int offset12 = offset11 + CountryPeer.numColumns;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                        
                            
              
                           omClass = StudentPeer.getOMClass();
                          Student obj2 = (Student)StudentPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj3 = (Zip)ZipPeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj3 = (Zip)temp_obj1.getZipRelatedByResidentialaddresszipid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddresszipid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj4 = (Province)ProvincePeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj4 = (Province)temp_obj1.getProvinceRelatedByResidentialaddressprovinceid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressprovinceid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj5 = (Country)CountryPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj5 = (Country)temp_obj1.getCountryRelatedByResidentialaddresscountryid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddresscountryid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj6 = (Zip)ZipPeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj6 = (Zip)temp_obj1.getZipRelatedByCollegeaddresszipid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddresszipid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj7 = (Province)ProvincePeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj7 = (Province)temp_obj1.getProvinceRelatedByCollegeaddressprovinceid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressprovinceid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj8 = (Country)CountryPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj8 = (Country)temp_obj1.getCountryRelatedByCollegeaddresscountryid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddresscountryid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj9 = (Zip)ZipPeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj9 = (Zip)temp_obj1.getZipRelatedByGuardianaddresszipid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByGuardianaddresszipid();
                obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj10 = (Province)ProvincePeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj10 = (Province)temp_obj1.getProvinceRelatedByGuardianaddressprovinceid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddressprovinceid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj11 = (Country)CountryPeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj11 = (Country)temp_obj1.getCountryRelatedByGuardianaddresscountryid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddresscountryid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
            }
                                                results.add(obj1);
        }
        return results;
    }
        
        
                                            
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptCountryRelatedByCollegeaddresscountryid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                    StudentPeer.addSelectColumns(c);
        int offset3 = offset2 + StudentPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset4 = offset3 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset5 = offset4 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset6 = offset5 + RegionPeer.numColumns;
                                                                
                                                  
                    ZipPeer.addSelectColumns(c);
        int offset7 = offset6 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset8 = offset7 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset9 = offset8 + RegionPeer.numColumns;
                                                                
                                                  
                    ZipPeer.addSelectColumns(c);
        int offset10 = offset9 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset11 = offset10 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset12 = offset11 + RegionPeer.numColumns;
                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                        
                            
              
                           omClass = StudentPeer.getOMClass();
                          Student obj2 = (Student)StudentPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj3 = (Zip)ZipPeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj3 = (Zip)temp_obj1.getZipRelatedByResidentialaddresszipid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddresszipid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj4 = (Province)ProvincePeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj4 = (Province)temp_obj1.getProvinceRelatedByResidentialaddressprovinceid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressprovinceid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj5 = (Region)RegionPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj5 = (Region)temp_obj1.getRegionRelatedByResidentialaddressregionid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddressregionid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj6 = (Zip)ZipPeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj6 = (Zip)temp_obj1.getZipRelatedByCollegeaddresszipid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddresszipid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj7 = (Province)ProvincePeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj7 = (Province)temp_obj1.getProvinceRelatedByCollegeaddressprovinceid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressprovinceid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj8 = (Region)RegionPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj8 = (Region)temp_obj1.getRegionRelatedByCollegeaddressregionid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddressregionid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj9 = (Zip)ZipPeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj9 = (Zip)temp_obj1.getZipRelatedByGuardianaddresszipid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByGuardianaddresszipid();
                obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj10 = (Province)ProvincePeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj10 = (Province)temp_obj1.getProvinceRelatedByGuardianaddressprovinceid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddressprovinceid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj11 = (Region)RegionPeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj11 = (Region)temp_obj1.getRegionRelatedByGuardianaddressregionid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddressregionid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
            }
                                                                    
                                              results.add(obj1);
        }
        return results;
    }
        
        
                                            
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptZipRelatedByGuardianaddresszipid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                    StudentPeer.addSelectColumns(c);
        int offset3 = offset2 + StudentPeer.numColumns;
                                                                
                                                  
                    ProvincePeer.addSelectColumns(c);
        int offset4 = offset3 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset5 = offset4 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset6 = offset5 + CountryPeer.numColumns;
                                                                
                                                  
                    ProvincePeer.addSelectColumns(c);
        int offset7 = offset6 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset8 = offset7 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset9 = offset8 + CountryPeer.numColumns;
                                                                
                                                  
                    ProvincePeer.addSelectColumns(c);
        int offset10 = offset9 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset11 = offset10 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset12 = offset11 + CountryPeer.numColumns;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                        
                            
              
                           omClass = StudentPeer.getOMClass();
                          Student obj2 = (Student)StudentPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj3 = (Province)ProvincePeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj3 = (Province)temp_obj1.getProvinceRelatedByResidentialaddressprovinceid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddressprovinceid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj4 = (Region)RegionPeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj4 = (Region)temp_obj1.getRegionRelatedByResidentialaddressregionid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressregionid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj5 = (Country)CountryPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj5 = (Country)temp_obj1.getCountryRelatedByResidentialaddresscountryid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddresscountryid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj6 = (Province)ProvincePeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj6 = (Province)temp_obj1.getProvinceRelatedByCollegeaddressprovinceid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddressprovinceid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj7 = (Region)RegionPeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj7 = (Region)temp_obj1.getRegionRelatedByCollegeaddressregionid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressregionid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj8 = (Country)CountryPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj8 = (Country)temp_obj1.getCountryRelatedByCollegeaddresscountryid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddresscountryid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj9 = (Province)ProvincePeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj9 = (Province)temp_obj1.getProvinceRelatedByGuardianaddressprovinceid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByGuardianaddressprovinceid();
                obj9.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj10 = (Region)RegionPeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj10 = (Region)temp_obj1.getRegionRelatedByGuardianaddressregionid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddressregionid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj11 = (Country)CountryPeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj11 = (Country)temp_obj1.getCountryRelatedByGuardianaddresscountryid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddresscountryid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
            }
                                                results.add(obj1);
        }
        return results;
    }
        
        
                                            
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptProvinceRelatedByGuardianaddressprovinceid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                    StudentPeer.addSelectColumns(c);
        int offset3 = offset2 + StudentPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset4 = offset3 + ZipPeer.numColumns;
                                                                
                                                  
                    RegionPeer.addSelectColumns(c);
        int offset5 = offset4 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset6 = offset5 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset7 = offset6 + ZipPeer.numColumns;
                                                                
                                                  
                    RegionPeer.addSelectColumns(c);
        int offset8 = offset7 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset9 = offset8 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset10 = offset9 + ZipPeer.numColumns;
                                                                
                                                  
                    RegionPeer.addSelectColumns(c);
        int offset11 = offset10 + RegionPeer.numColumns;
                                                                
                    CountryPeer.addSelectColumns(c);
        int offset12 = offset11 + CountryPeer.numColumns;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                        
                            
              
                           omClass = StudentPeer.getOMClass();
                          Student obj2 = (Student)StudentPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj3 = (Zip)ZipPeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj3 = (Zip)temp_obj1.getZipRelatedByResidentialaddresszipid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddresszipid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj4 = (Region)RegionPeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj4 = (Region)temp_obj1.getRegionRelatedByResidentialaddressregionid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressregionid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj5 = (Country)CountryPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj5 = (Country)temp_obj1.getCountryRelatedByResidentialaddresscountryid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddresscountryid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj6 = (Zip)ZipPeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj6 = (Zip)temp_obj1.getZipRelatedByCollegeaddresszipid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddresszipid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj7 = (Region)RegionPeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj7 = (Region)temp_obj1.getRegionRelatedByCollegeaddressregionid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressregionid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj8 = (Country)CountryPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj8 = (Country)temp_obj1.getCountryRelatedByCollegeaddresscountryid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddresscountryid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj9 = (Zip)ZipPeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj9 = (Zip)temp_obj1.getZipRelatedByGuardianaddresszipid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByGuardianaddresszipid();
                obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj10 = (Region)RegionPeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj10 = (Region)temp_obj1.getRegionRelatedByGuardianaddressregionid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddressregionid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj11 = (Country)CountryPeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj11 = (Country)temp_obj1.getCountryRelatedByGuardianaddresscountryid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddresscountryid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
            }
                                                results.add(obj1);
        }
        return results;
    }
        
        
                                            
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptRegionRelatedByGuardianaddressregionid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                    StudentPeer.addSelectColumns(c);
        int offset3 = offset2 + StudentPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset4 = offset3 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset5 = offset4 + ProvincePeer.numColumns;
                                                                
                                                  
                    CountryPeer.addSelectColumns(c);
        int offset6 = offset5 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset7 = offset6 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset8 = offset7 + ProvincePeer.numColumns;
                                                                
                                                  
                    CountryPeer.addSelectColumns(c);
        int offset9 = offset8 + CountryPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset10 = offset9 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset11 = offset10 + ProvincePeer.numColumns;
                                                                
                                                  
                    CountryPeer.addSelectColumns(c);
        int offset12 = offset11 + CountryPeer.numColumns;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                        
                            
              
                           omClass = StudentPeer.getOMClass();
                          Student obj2 = (Student)StudentPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj3 = (Zip)ZipPeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj3 = (Zip)temp_obj1.getZipRelatedByResidentialaddresszipid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddresszipid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj4 = (Province)ProvincePeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj4 = (Province)temp_obj1.getProvinceRelatedByResidentialaddressprovinceid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressprovinceid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj5 = (Country)CountryPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj5 = (Country)temp_obj1.getCountryRelatedByResidentialaddresscountryid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddresscountryid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj6 = (Zip)ZipPeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj6 = (Zip)temp_obj1.getZipRelatedByCollegeaddresszipid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddresszipid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj7 = (Province)ProvincePeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj7 = (Province)temp_obj1.getProvinceRelatedByCollegeaddressprovinceid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressprovinceid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj8 = (Country)CountryPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj8 = (Country)temp_obj1.getCountryRelatedByCollegeaddresscountryid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddresscountryid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddresscountryid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj9 = (Zip)ZipPeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj9 = (Zip)temp_obj1.getZipRelatedByGuardianaddresszipid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByGuardianaddresszipid();
                obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj10 = (Province)ProvincePeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj10 = (Province)temp_obj1.getProvinceRelatedByGuardianaddressprovinceid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddressprovinceid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = CountryPeer.getOMClass();
                          Country obj11 = (Country)CountryPeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Country temp_obj11 = (Country)temp_obj1.getCountryRelatedByGuardianaddresscountryid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddresscountryid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddresscountryid(obj1);
            }
                                                results.add(obj1);
        }
        return results;
    }
        
        
                                            
                

    /**
     * selects a collection of StudentPersonalInformation objects pre-filled with
     * all related objects.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in StudentPersonalInformationPeer.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static List doSelectJoinAllExceptCountryRelatedByGuardianaddresscountryid(Criteria c)
        throws TorqueException
    {
        // Set the correct dbName if it has not been overridden
        // c.getDbName will return the same object if not set to another value
        // so == check is okay and faster
        if (c.getDbName() == Torque.getDefaultDB())
        {
            c.setDbName(DATABASE_NAME);
        }

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                                    
                    StudentPeer.addSelectColumns(c);
        int offset3 = offset2 + StudentPeer.numColumns;
                                                                
                    ZipPeer.addSelectColumns(c);
        int offset4 = offset3 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset5 = offset4 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset6 = offset5 + RegionPeer.numColumns;
                                                                
                                                  
                    ZipPeer.addSelectColumns(c);
        int offset7 = offset6 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset8 = offset7 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset9 = offset8 + RegionPeer.numColumns;
                                                                
                                                  
                    ZipPeer.addSelectColumns(c);
        int offset10 = offset9 + ZipPeer.numColumns;
                                                                
                    ProvincePeer.addSelectColumns(c);
        int offset11 = offset10 + ProvincePeer.numColumns;
                                                                
                    RegionPeer.addSelectColumns(c);
        int offset12 = offset11 + RegionPeer.numColumns;
                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
        List rows = BasePeer.doSelect(c);
        List results = new ArrayList();

        for (int i = 0; i < rows.size(); i++)
        {
            Record row = (Record)rows.get(i);

                            Class omClass = StudentPersonalInformationPeer.getOMClass();
                    StudentPersonalInformation obj1 = (StudentPersonalInformation)StudentPersonalInformationPeer
                .row2Object(row, 1, omClass);
                                                
                                                        
                            
              
                           omClass = StudentPeer.getOMClass();
                          Student obj2 = (Student)StudentPeer
                .row2Object( row, offset2, omClass);

               boolean  newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Student temp_obj2 = (Student)temp_obj1.getStudent();
                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj2.addStudentPersonalInformation(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initStudentPersonalInformations();
                obj2.addStudentPersonalInformation(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj3 = (Zip)ZipPeer
                .row2Object( row, offset3, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj3 = (Zip)temp_obj1.getZipRelatedByResidentialaddresszipid();
                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initStudentPersonalInformationsRelatedByResidentialaddresszipid();
                obj3.addStudentPersonalInformationRelatedByResidentialaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj4 = (Province)ProvincePeer
                .row2Object( row, offset4, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj4 = (Province)temp_obj1.getProvinceRelatedByResidentialaddressprovinceid();
                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj4.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj4.initStudentPersonalInformationsRelatedByResidentialaddressprovinceid();
                obj4.addStudentPersonalInformationRelatedByResidentialaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj5 = (Region)RegionPeer
                .row2Object( row, offset5, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj5 = (Region)temp_obj1.getRegionRelatedByResidentialaddressregionid();
                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj5.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj5.initStudentPersonalInformationsRelatedByResidentialaddressregionid();
                obj5.addStudentPersonalInformationRelatedByResidentialaddressregionid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj6 = (Zip)ZipPeer
                .row2Object( row, offset6, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj6 = (Zip)temp_obj1.getZipRelatedByCollegeaddresszipid();
                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj6.initStudentPersonalInformationsRelatedByCollegeaddresszipid();
                obj6.addStudentPersonalInformationRelatedByCollegeaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj7 = (Province)ProvincePeer
                .row2Object( row, offset7, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj7 = (Province)temp_obj1.getProvinceRelatedByCollegeaddressprovinceid();
                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj7.initStudentPersonalInformationsRelatedByCollegeaddressprovinceid();
                obj7.addStudentPersonalInformationRelatedByCollegeaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj8 = (Region)RegionPeer
                .row2Object( row, offset8, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj8 = (Region)temp_obj1.getRegionRelatedByCollegeaddressregionid();
                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj8.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj8.initStudentPersonalInformationsRelatedByCollegeaddressregionid();
                obj8.addStudentPersonalInformationRelatedByCollegeaddressregionid(obj1);
            }
                                                                    
                                                                  
                                                                        
                            
              
                           omClass = ZipPeer.getOMClass();
                          Zip obj9 = (Zip)ZipPeer
                .row2Object( row, offset9, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Zip temp_obj9 = (Zip)temp_obj1.getZipRelatedByGuardianaddresszipid();
                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj9.initStudentPersonalInformationsRelatedByGuardianaddresszipid();
                obj9.addStudentPersonalInformationRelatedByGuardianaddresszipid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = ProvincePeer.getOMClass();
                          Province obj10 = (Province)ProvincePeer
                .row2Object( row, offset10, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Province temp_obj10 = (Province)temp_obj1.getProvinceRelatedByGuardianaddressprovinceid();
                if (temp_obj10.getPrimaryKey().equals(obj10.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj10.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj10.initStudentPersonalInformationsRelatedByGuardianaddressprovinceid();
                obj10.addStudentPersonalInformationRelatedByGuardianaddressprovinceid(obj1);
            }
                                                                    
                                                                        
                            
              
                           omClass = RegionPeer.getOMClass();
                          Region obj11 = (Region)RegionPeer
                .row2Object( row, offset11, omClass);

               newObject = true;
            for (int j = 0; j < results.size(); j++)
            {
                StudentPersonalInformation temp_obj1 = (StudentPersonalInformation)results.get(j);
                Region temp_obj11 = (Region)temp_obj1.getRegionRelatedByGuardianaddressregionid();
                if (temp_obj11.getPrimaryKey().equals(obj11.getPrimaryKey()))
                {
                    newObject = false;
                    temp_obj11.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj11.initStudentPersonalInformationsRelatedByGuardianaddressregionid();
                obj11.addStudentPersonalInformationRelatedByGuardianaddressregionid(obj1);
            }
                                                                    
                                              results.add(obj1);
        }
        return results;
    }
                    
  
      /**
     * Returns the TableMap related to this peer.  This method is not
     * needed for general use but a specific application could have a need.
     *
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    protected static TableMap getTableMap()
        throws TorqueException
    {
        return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME);
    }
   }
